import {axios, axios2, axios3} from '@/config/axios'
import {jsonToQueryStr} from '@/utils'
// import './tempdata/tuwen' // 图文mock数据
// import './tempdata/weibo' // 微博mock数据

const appJson = {headers: {'Content-Type': 'application/json'}}
/* 系统管理 */
/* 获取左侧菜单 */
export const getMenu = () => axios3.get('/system/menu/get')
/* 获取左侧菜单 */
export const getCaptcha = () => axios.get('/validate/getcaptcha')
/* 获取架构权限菜单 */
export const getGroupMenu = () => axios.post('/menu/group')
/* 获取用户列表 */
export const getUserList = (payload = {}) => axios.post('/sys/member/list', payload)
/* 获取分部列表 */
// export const getBranchList = () => axios3.get('/wxwork/department/tree')
export const getBranchList = () => axios3.get('/online/architecture/department/tree')
/* 获取企业微信用户 */
// export const getBranchUser = departmentId => axios3.get('/wxwork/user/department', {params: {departmentId}})
export const getBranchUser = departmentId => axios3.get('/online/architecture/department/user', {params: {departmentId}})
/* 搜索企业微信用户 */
//export const getBranchUser2 = (username, num) => axios3.get('/wxwork/user/search', {params: {username, num}})
export const getBranchUser2 = (username, size, page) => axios3.get('/online/architecture/user/search', {
  params: {
    username,
    size,
    page
  }
})
/* 同步企业微信用户数据 */
export const syncBranchUser = () => axios3.get('/wxwork/department/sync')
/* 授权企业用户登录 */
// export const authBranchUser = payload => axios3.post('/wxwork/user/authorized', payload)
export const authBranchUser = payload => axios3.post('/online/architecture/user/authorize', payload)
/* 扫码授权认证回调 */
export const scanloginCallback = payload => axios3.post('/wxwork/scanlogin/code', payload)
/* 关键字搜索用户列表 */
export const getUserByWD = (wd, size) => axios.post('/sys/member/search', {wd, size})
/* 获取用户信息 */
export const getUserInfo = () => axios3.get('/system/member/baseinfo')
/* 获取用户信息（带编辑状态） */
export const getUserEditInfo = uid => axios.get('/sys/member/info', {params: {uid}})
/* 新增单个用户 */
export const addUser = (payload) => axios.post('/sys/member/create', payload)
/* 编辑用户信息 */
export const editUser = (payload) => axios.post('/sys/member/edit', payload)
/* 修改用户密码 */
export const editUserPSW = (oldPasswd, newPasswd) => axios.post('/sys/member/changepasswd', {oldPasswd, newPasswd})
/* 重置密码 */
export const resetUserPSW = (uid, passwd) => axios.post('/sys/member/resetpasswd', {uid, passwd})
/* 修改密码 */
export const changeUserPSW = (oldPasswd, newPasswd) => axios.post('/sys/member/changepasswd', {oldPasswd, newPasswd})
/* 冻结用户 */
export const freezeUser = (uid) => axios.post('/sys/member/freeze', {uid})
/* 解冻用户 */
export const unfreezeUser = (uid) => axios.post('/sys/member/unfreeze', {uid})
/* 登陆 */
export const signIn = (payload) => axios.post('/login/ordinary', payload)
export const signInIdm = (payload) => axios3.post('/system/login/account', payload)
/* 企业微信扫码登入跳转页面URL */
export const getEnterpriseUrl = (redirectUrl) => axios3.post('/wxwork/scanlogin/qr', {redirectUrl})
/* 获取架构列表 */
export const getGroupList = () => axios.get('/sys/group/list')
/* 添加架构 */
export const addGroup = (name) => axios.post('/sys/group/create', {name})
/* 修改架构 */
export const modifyGroup = (gid, name) => axios.post('/sys/group/edit', {gid, name})
/* 删除架构 */
export const delGroup = (gid) => axios.post('/sys/group/delete', {gid: gid})
/* 获取角色列表 */
export const getRoleList = () => axios.get('/sys/character/list')
/* 获取角色列表（根据权限） */
export const getRoleList2 = () => axios.get('/sys/character/select')
/* 获取角色详细信息 */
export const getRoleDetail = (cid) => axios.post('/sys/character/info', {cid: +cid})
/* 获取所有权限信息 */
export const getAuthList = () => axios.get('/sys/authority/list')
/* 新增角色 */
export const addRole = (name, authority) => axios.post('/sys/character/create', {name, authority})
/* 编辑角色 */
export const editRole = (cid, name, authority) => axios.post('/sys/character/edit', {cid, name, authority})
/* 删除角色 */
export const delRole = (cid) => axios.post('/sys/character/delete', {cid})
/* 获取系统日志 */
export const getSysLogs = (payload = {}) => axios.post('/sys/log/list', payload)

/* 客户管理 */
/* 标签库模块 */
/* 创建标签分类 */
export const addTagClass = (name, pid, gid) => axios.post('/customer/tag/group/create', {name, pid, gid})
/* 删除标签分类 */
export const delTagClass = (payload) => axios.post('/customer/tag/group/delete', payload)
/* 通过父节点获取子分类 */
export const getChildTags = (pid, gid) => axios.post('/customer/tag/group/child', {pid, gid})
/* 检索Tag */
export const searchTags = (payload) => axios.post('/customer/tag/search', payload)
/* 获取标签树 */
export const getTagTree = (gid) => axios.get('/customer/tag/group/tree', {params: {gid}})
/* 获取子标签分类 */
export const getChildTagClass = (gid, pid) => axios.post('/customer/tag/group/child', {gid, pid})
/* 批量移动标签 */
export const moveTags = payload => axios.post('/customer/tag/move', payload, {headers: {'Content-Type': 'application/json'}})
/* 创建标签 */
export const addTag = (tagName, pid, gid) => axios.post('/customer/tag/create', {tagName, pid, gid})
/* 删除标签 */
export const delTag = payload => axios.post('/customer/tag/delete', payload)
/* 修改标签 */
export const editTag = payload => axios.post('/customer/tag/name/edit', payload)
/* 标签置顶 */
export const setTopTag = (tagId, top) => axios.post('/customer/tag/top', {tagId, top})
/* 会员打标签1(勾选的用户) */
export const addCusTagByID = payload => axios.post('/customer/tag/tagged/select', payload, {headers: {'Content-Type': 'application/json'}})
/* 会员打标签2(筛选条件) */
export const addCusTagByCondition = payload => axios.post('/customer/tag/tagged/condition', payload, {headers: {'Content-Type': 'application/json'}})
/* 会员删除标签 */
export const delCusTag = payload => axios.post('/customer/tag/tagged/delete', payload, {headers: {'Content-Type': 'application/json'}})
/* 客户会员模块 */
/* 筛选条件联动 */
export const getConditions = (pid) => axios.post('/customer/fans/condition', {pid: pid})
/* 获取会员列表 */
export const getCustomers = payload => axios.post('/customer/fans/search/simple', payload)
/* 高级搜索接口 */
export const seniorSearch = payload => axios.post('/customer/fans/search/advanced', payload, {headers: {'Content-Type': 'application/json'}})
/* 获取用户标签列表 */
export const getCustomerTags = (sid) => axios.post('/customer/fans/tag', {ssoid: sid})
/* 获取用户标签列表 (带分类信息) */
export const getCusTagsWithClass = ssoid => axios.post('/customer/fans/tagwithclass', {ssoid})
/* 获取用户基本信息 */
export const getCustomerInfo = (ssoid, type) => axios.post('/customer/fans/info', {ssoid, type})
/* 获取用户家电信息 */
export const getCusDeviceInfo = ssoid => axios.post('/customer/fans/device', {ssoid})
/* 获取会员列表展示字段 */
export const getCustomerTh = () => axios.post('/customer/fans/info/field')
/* 保存会员列表展示字段 */
export const setCustomerTh = (payload) => axios.post('/customer/fans/info/field/save', payload, {headers: {'Content-Type': 'application/json'}})
/* 查询订单概述数据 */
export const getCusSummary = ssoid => axios2.get('/customer/fans/order/info/detail?ssoid=' + ssoid)
/* 导入客户交易信息 */
export const importCusData = payload => axios2.post('/customer/fans/order/import/' + payload.ssoid, payload, {headers: {'Content-Type': 'multipart/form-data; charset=utf-8;'}})
/* 获取Excel数据 */
export const getCusDetail = payload => axios2.get('/customer/fans/order/list/page', {params: payload})
/* 群组模块 */
/* 获取群组列表 */
export const getCusGroups = payload => axios.post('/customer/group/list', payload)
/* 删除群组 */
export const delGroups = groupId => axios.post('/customer/group/delete', groupId, {headers: {'Content-Type': 'application/json'}})
/* 创建动态群组 */
export const createDynamicGroup = payload => axios.post('/customer/group/create/dynamic', payload, {headers: {'Content-Type': 'application/json'}})
/* 创建动态群组-意向客户 */
export const createDynamicGroup2 = payload => axios.post('/customer/group/buyer/create/dynamic', payload, {headers: {'Content-Type': 'application/json'}})
/* 更改动态群组条件-意向客户 */
export const createDynamicGroup3 = payload => axios.post('/customer/group/buyer/edit/dynamic', payload, {headers: {'Content-Type': 'application/json'}})
/* 创建静态群组(筛选结果) */
export const createStaticGroup1 = payload => axios.post('/customer/group/create/static/condition', payload, {headers: {'Content-Type': 'application/json'}})
/* 创建静态群组(勾选选项) */
export const createStaticGroup2 = payload => axios.post('/customer/group/create/static/select', payload, {headers: {'Content-Type': 'application/json'}})
/* 创建静态群组(意向客户) */
export const createStaticGroup3 = payload => axios.post('/customer/group/buyer/static/create', payload, {headers: {'Content-Type': 'application/json'}})
/* 删除群组(当前群组置入历史群组) */
export const deleteGroup = groupId => axios.post('/customer/group/delete', groupId, {headers: {'Content-Type': 'application/json'}})
/* 获取群组详情 */
export const getCusGroupDetail = groupId => axios.post('/customer/group/detail', {groupId})
/* 静态群组增加成员(按勾选) */
export const addToStaticGroup = payload => axios.post('/customer/group/fans/add', payload, {headers: {'Content-Type': 'application/json'}})
/* 静态群组增加成员(按筛选结果) */
export const addToStaticGroup2 = payload => axios.post('/customer/group/fans/add/dynamic', payload, {headers: {'Content-Type': 'application/json'}})
/* 静态群组增加成员-意向客户(添加已有) */
export const addToStaticGroup3 = payload => axios.post('/customer/group/buyer/static/import', payload, {headers: {'Content-Type': 'application/json'}})
/* 获取用户群组信息 */
export const getGroupsInCus = ssoid => axios.post('customer/fans/group', {ssoid})
/* 群组中去除成员 */
export const delCusFromGroup = payload => axios.post('/customer/group/fans/delete', payload, {headers: {'Content-Type': 'application/json'}})
/* 修改群组名称 */
export const editGroupName = payload => axios.post('/customer/group/name/edit', payload)
/* 动态群组条件编辑 */
export const editDynamicGroup = payload => axios.post('/customer/group//edit/dynamic', payload, {headers: {'Content-Type': 'application/json'}})
/* 获取动态群组中用户数量 */
export const getDynamicGroupNum = groupId => axios.post('/customer/group/dynamic/num', {groupId})
/* 批量删除标签 */
export const deleteTagsMore = payload => axios.post('/customer/tag/delete/batch', payload, {headers: {'Content-Type': 'application/json'}})
/* 下载意向客户导入excel模板 */
export const downloadTemp = payload => axios.post('/customer/buyer/excel/template', payload)
/* 导入excel意向用户数据 */
export const importTempFile = payload => axios.post('/customer/buyer/excel/import', payload)
/* 获取意向客户列表 */
export const getCustList = payload => axios.post('/customer/buyer/list', payload)

/* 内容 */
/* 素材库 */
/* 列表（搜索） */
export const getSourceList = payload => axios.post('/content/source/list', payload)
/* 上传视频素材 */
export const uploadVideo = payload => axios.post('/content/source/upload/video', payload, {headers: {'Content-Type': 'Content-Type: multipart/form-data; charset=utf-8;'}})
/* 上传图片素材 */
export const uploadImage = payload => axios.post('/content/source/upload/image', payload, {headers: {'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundarykKoZ6uW4sJYJLrGM'}})
/* 上传音频素材 */
export const uploadAudio = payload => axios.post('/content/source/upload/audio', payload, {headers: {'Content-Type': 'Content-Type: multipart/form-data; charset=utf-8;'}})
/* 创建文件夹 */
export const createFolder = payload => axios.post('/content/source/create/folder', payload)
/* 删除素材 */
export const delSource = payload => axios.post('/content/source/delete', payload, {headers: {'Content-Type': 'application/json'}})
/* 删除文件夹 */
export const delFolder = id => axios.post('/content/source/delete/folder', {id})
/* 获取图片素材库目录 */
export const getImageDir = () => axios.post('/content/source/image/dir')
/* 修改素材库目录名称 */
export const editFolder = payload => axios.post('/content/source/edit/folder', payload)
/* 移动图片素材目录 */
export const moveSourceDir = payload => axios.post('/content/source/move', payload, {headers: {'Content-Type': 'application/json'}})
/* 点赞接口 */
export const thumbSource = sourceId => axios.post('/content/source/love', {sourceId})
/* 自媒体管理 */
/* 获取微信授权的跳转地址 */
export const getWechatAuthUrl = redirect => axios.post('/content/weixin/authurl', {redirect})
/* 向服务器上报微信authCode */
export const validateWechatAuth = payload => axios.post('/content/weixin/authupload', payload)
/* 微信公众号列表 */
export const getWechatList = payload => axios.post('/content/weixin/list', payload)
/* 获取微信公众号是否授权 */
export const getWechatIsAuth = appid => axios.post('/content/weixin/authorize', {appid})
/* 获取微信公众号自定义菜单 */
export const getWechatMenu = appid => axios.post('/content/weixin/customemenu/get', {appid})
/* 保存公众号自定义菜单 */
export const saveWechatMenu = payload => axios.post('/content/weixin/customemenu/set?appid=' + payload.appid, payload.menus, {headers: {'Content-Type': 'application/json'}})
/* 删除公众号自定义菜单 */
export const delWechatMenu = appid => axios.get('/content/weixin/customemenu/del', {params: {appid}})
/* 获取微信自定义菜单素材信息 */
export const getWxMenuSource = payload => axios.post('/content/weixin/mediaid/menu/info', payload)
/* 获取短信平台数据 */
export const getSmsPlateList = payload => axios.post('/content/smsplt/list', payload)
/* 获取邮件平台数据 */
export const getMailPlateList = payload => axios.post('/content/emailplt/list', payload)
/* 选择素材库中素材, 返回素材库信息 和 微信公众号素材库信息 */
export const getSourceInfo = payload => axios.post('/content/weixin/mediaid/get', payload)
/* 使用mediaid获取素材基础信息 */
export const getSourceMoreInfo = mediaid => axios.post('/content/weixin/mediaid/info', {mediaid})
/* 获取粉丝列表 */
export const getwxFansList = payload => axios.post('/content/weixin/fans/list ', payload)
/* 获取标签列表 */
export const getwxFansTagList = appid => axios.post('/content/weixin/tag/list', {appid})
/* 添加新标签 */
export const addWxTag = payload => axios.post('/content/weixin/tag/create', payload)
/* 删除微信标签 */
export const delWxTag = payload => axios.post('/content/weixin/tag/delete', payload, {headers: {'Content-Type': 'application/json'}})
/* 给用户打标签 */
export const addTagToUser = payload => axios.post('/content/weixin/tag/tagged', payload, {headers: {'Content-Type': 'application/json'}})
/* 微信拉黑粉丝 */
export const addToBlack = payload => axios.post('/content/weixin/black/tagged', payload, {headers: {'Content-Type': 'application/json'}})
/* 触发同步 */
export const triggerUpdateFans = payload => axios.post('/content/weixin/syn', payload)
/* 同步更新粉丝进度 */
export const syncUpdateFans = payload => axios.post('/content/weixin/syn/progress', payload)
/* 获取单个微信公众号的基础信息 */
export const getWechatInfo = appid => axios.post('/content/weixin/accountinfo/get', {appid})
/* 获取关注的回复信息 */
export const getSubscribeReply = appid => axios.post('/content/weixin/reply/subscribe/get', {appid})
/* 编辑关注的回复信息 */
export const setSubscribeReply = payload => axios.post('/content/weixin/reply/subscribe/set', payload, {headers: {'Content-Type': 'application/json'}})
/* 启用/停用关注回复 */
export const setIfSubReply = payload => axios.post('/content/weixin/reply/subscribe/switch', payload)
/* 获取默认回复消息 */
export const getDefaultReply = appid => axios.post('/content/weixin/reply/message/default/get', {appid})
/* 编辑默认自动回复消息 */
export const setDefaultReply = payload => axios.post('/content/weixin/reply/message/default/edit', payload)
/* 切换默认消息回复状态 */
export const setIfDefaultReply = payload => axios.post('/content/weixin/reply/message/default/switch', payload)
/* 获取关键字回复列表 */
export const getKeywordReply = payload => axios.post('/content/weixin/reply/message/get', payload)
/* 编辑关键字回复列表 */
export const setKeywordReply = payload => axios.post('/content/weixin/reply/message/edit', payload)
/* 删除关键字回复词条 */
export const delKeywordReply = payload => axios.post('/content/weixin/reply/message/del', payload)
/* 切换关键字词条回复使用状态 */
export const setIfKeywordReply = payload => axios.post('/content/weixin/reply/message/switch', payload)
/* 获取回复小尾巴 */
export const getReplyTail = appid => axios.post('/content/weixin/reply/tail/get', {appid})
/* 编辑回复小尾巴内容 */
export const setReplyTail = payload => axios.post('/content/weixin/reply/tail/set', payload)
/* 切换回复小尾巴启用状态 */
export const setIfReplyTail = payload => axios.post('/content/weixin/reply/tail/switch', payload)
/* 获取客服列表 */
export const getKefuList = appid => axios.post('/content/weixin/kf/list', {appid})
/* 获取在线客服列表 */
export const getKefuListOnline = appid => axios.post('/content/weixin/kf/list/online', {appid})
/* 创建客服账号 */
export const addKefuAccount = payload => axios.post('/content/weixin/kf/account/add', payload)
/* 邀请个人微信号绑定客服 */
export const bindKefuAccount = payload => axios.post('/content/weixin/kf/account/invite', payload)
/* 设置客服头像 */
export const setKefuAvatar = payload => axios.post('/content/weixin/kf/account/avatar', payload)
/* 设置客服账号信息 */
export const setKefuInfo = payload => axios.post('/content/weixin/kf/account/set', payload)
/* 删除客服账号 */
export const delKefuAccount = payload => axios.post('/content/weixin/kf/account/del', payload)
/* 管理员信息 */
export const setAdminInfo = payload => axios.post('/content/weixin/admininfo/edit', payload)

/* 自媒体管理-微博 */
/* 获取授权信息 */
export const getWbAuthInfo = () => axios.post('/content/weibo/authinfo')
/* 提交accessToken */
export const commitWbToken = payload => axios.post('/content/weibo/save', payload)
/* 微博下发授权给其他用户 */
export const authToUserWb = payload => axios.post('/content/weibo/authorization', payload)
/* 微博管理列表 */
export const getWbList = payload => axios.post('/content/weibo/list', payload)
/* 获取自定义菜单 */
export const getWbMenus = appid => axios.post('/content/weibo/menu/get', {appid})
/* 设置自定义菜单 */
export const setWbMenus = payload => axios.post('/content/weibo/menu/set', payload, {headers: {'Content-Type': 'application/json'}})
/* 获取关注自动回复 */
export const getWbSubscribeReply = appid => axios.post('/content/weibo/reply/follow/get', {appid})
/* 设置关注自动回复 */
export const setWbSubscribeReply = payload => axios.post('/content/weibo/reply/follow/set', payload)
/* 切换关注自动回复状态 */
export const setWbSubReplyStatus = payload => axios.post('/content/weibo/reply/follow/switch', payload)
/* 获取默认回复 */
export const getWbDefaultReply = appid => axios.post('/content/weibo/reply/default/get', {appid})
/* 设置微博默认回复 */
export const setWbDefaultReply = payload => axios.post('/content/weibo/reply/default/set', payload)
/* 切换默认回复使用状态 */
export const setWbDefReplyStatus = payload => axios.post('/content/weibo/reply/default/switch', payload)
/* 获取回复小尾巴 */
export const getWbReplyTail = appid => axios.post('/content/weibo/reply/tail/get', {appid})
/* 设置微博回复小尾巴 */
export const setWbReplyTail = payload => axios.post('/content/weibo/reply/tail/set', payload)
/* 切换回复小尾巴使用状态 */
export const setWbReplyTailStatus = payload => axios.post('/content/weibo/reply/tail/switch', payload)
/* 获取关键字列表 */
export const getWbKwReply = payload => axios.post('/content/weibo/reply/keyword/get', payload)
/* 新增或者设置关键字回复 */
export const setWbKwReply = payload => axios.post('/content/weibo/reply/keyword/set', payload)
/* 删除关键字回复 */
export const delWbKwReply = payload => axios.post('/content/weibo/reply/keyword/del', payload)
/* 粉丝数据列表 */
export const getWbFansList = payload => axios.post('/content/weibo/fans/list', payload)
/* 获取群组列表 */
export const getWbGroupList = payload => axios.post('/content/weibo/fans/group/list', payload)
/* 创建群组 */
export const createWbGroup = payload => axios.post('/content/weibo/fans/group/add', payload)
/* 更新分组名称 */
export const updateWbGroup = payload => axios.post('/content/weibo/fans/group/update', payload)
/* 删除群组 */
export const delWbGroup = payload => axios.post('/content/weibo/fans/group/del', payload)
/* 获取用户分组信息 */
export const getWbFansGroup = payload => axios.post('/content/weibo/fans/group/fans/info', payload)
/* 设置用户分组 */
export const setWbFansGroup = payload => axios.post('/content/weibo/fans/group/fans/set', payload)
/* 获取微博动态列表 */
export const getMyWbList = payload => axios.post('/content/weibo/news/list', payload)
/* 获取微博表情 */
export const getWbEmotions = appid => axios.post('/content/weibo/emotion', {appid})
/* 发送微博动态 */
export const sendWeibo = payload => axios.post('/content/weibo/news/push', payload)
/* 微博粉丝同步 */
export const wbFansSync = appid => axios.post('/content/weibo/fans/syn', {appid})
/* 内容模块 */
/* 获取图文详情 */
export const getWxNewsDetail = id => axios.post('/content/wxnews/get', {id})
/* sourceId 换取 微信素材信息 */
export const getWxSourceInfo2 = sourceId => axios.post('/content/wxnews/picture/url', {sourceId})
/* 获取微信图文列表（我的内容） */
export const getWxNewsList = payload => axios.post('/content/wxnews/list/self', payload)
/* 图文素材id 获取 mediaid */
export const getWxNewsMediaid = payload => axios.post('/content/weixin/mediaid/news/get', payload)
/* 图文mediaid 获取 换取图文信息 */
export const getWxNewsByMediaid = payload => axios.post('/content/weixin/mediaid/news/info', payload)
/* 参数二维码 */
/* 创建二维码 */
export const createWxQrCode = (appid, wd) => axios.post('/content/weixin/qr/create', {appid, wd})
/* 获取二维码列表 */
export const getWxQrCodeList = payload => axios.post('/content/weixin/qr/list', payload)
/* 启用关闭 */
export const getSwitchStatus = (qrId, status) => axios.post('/content/weixin/qr/switch', {qrId, status})
/* 获取关键词 */
export const getQrKeyword = qrId => axios.post('/content/weixin/qr/keyword/get', qrId)
/* 设置关键词 */
export const setQrKeyword = (qrId, keywordId) => axios.post('/content/weixin/qr/keyword/set', {qrId, keywordId})
/* 删除关键词 */
export const delQrKeyword = qrId => axios.post('/content/weixin/qr/keyword/del', qrId)
/* 获取意向购机客户营销次数 */
export const querySaleRecord = payload => axios.post('/customer/buyer/send/record', payload)
/* 获取参数二维码标签列表 */
export const getQrTagList = qrId => axios.post('/content/weixin/qr/tag/get', qrId)
/* 添加参数二维码标签 */
export const addQrTags = payload => axios.post('/content/weixin/qr/tag/add', payload)
/* 删除参数二维码标签 */
export const delQrTags = payload => axios.post('/content/weixin/qr/tag/del', payload)
/* 获取参数二维码自动回复信息 */
export const getQrReply = qrId => axios.post('/content/weixin/qr/message/get', {qrId})
/* 设置参数二维码自动回复信息 */
export const setQrReply = payload => axios.post('/content/weixin/qr/message/edit', payload)
/* 获取微信图文列表（公共内容） */
export const getWxNewsList2 = payload => axios.post('/content/wxnews/list/common', payload)
/* 获取微信图文列表（事业部内容） */
export const getWxNewsList3 = payload => axios.post('/content/wxnews/list/group', payload)
/* 保存微信图文 */
export const setWxNews = payload => axios.post('/content/wxnews/save', payload, {headers: {'Content-Type': 'application/json'}})
/* 同步微信图文 */
export const syncWxNews = appid => axios.post('/content/wxnews/sync', {appid})
/* 删除微信图文 */
export const delWxNews = appids => axios.post('/content/common/del', appids, {headers: {'Content-Type': 'application/json'}})
/* 获取微信图文发送列表 */
export const getWxSendPlans = payload => axios.post('/content/sendplan/wx/list', payload)
/* 新建图文发送计划 */
export const addWxSendPlan = payload => axios.post('/content/sendplan/wx/create', payload, {headers: {'Content-Type': 'application/json'}})
/* 更改发送计划状态 */
export const setWxSendPlanStatus = payload => axios.post('/content/sendplan/switch/status', payload)
/* 获取内容性质 */
export const getContentTypes = () => axios.post('/content/attributes/all')
/* 新增微信内容性质 */
export const addContentType = payload => axios.post('/content/attributes/create', payload)
/* 编辑微信内容性质 */
export const setContentType = payload => axios.post('/content/attributes/edit', payload)
/* 删除微信内容性质 */
export const delContentType = attrId => axios.post('/content/attributes/del', {attrId})
/* 内容--微页面 */
/* 获取微页面列表 */
export const getWePageList = payload => axios2.post('/content/micro/list', payload, appJson)
/* 获取事业部，公共内容库微页面列表 */
export const getWePageList2 = payload => axios2.post('/content/micro/find/page/grouporcommon', payload, appJson)
/* 保存微页面 */
export const saveWePage = payload => axios2.post('/content/micro/saveorupdate', payload, appJson)
/* 获取微页面 */
export const getWePageDetail = id => axios2.get('/content/micro/get/one/' + id)
/* 批量删除微页面 */
export const delWePages = ids => axios2.post('/content/micro/delete/batch', ids, appJson)
/* 移动到内容性质 */
export const moveWepages = payload => axios2.post('/content/micro/move/attributes', payload, appJson)
/* 发布微页面 */
export const publicWepage = id => axios2.post('/content/micro/publish/' + id)
/* 预览二维码 */
export const previewWepage = id => axios2.get('/content/micro/get/qrcode/' + id)
/* 微页面发布审核 */
export const wePageAuditList = payload => axios2.post('/content/micro/audit/list', payload, appJson)
/* 微页面微信信息设置接口 */
export const setWePageWxInfo = payload => axios2.post('/content/micro/wx/info/set', payload)
/* 微页面微信信息获取接口 */
export const getWePageWxInfo = logicId => axios2.get('/content/micro/wx/info/get', {params: {logicId}})
/* 新建微页面微信公众号发送任务 */
export const addWePageSendPlan = payload => axios2.post('/content/micro/wx/sendplan/create', payload, appJson)
/* 获取微信公众号发送计划列表 */
export const getWePageSendPlan = payload => axios2.post('/content/micro/wx/sendplan/list', payload)
/* 内容--海报 */
/* 添加海报模型 */
export const addPoster = payload => axios3.post('/poster/poster/add', payload)
/* 修改海报模型 */
export const updatePoster = payload => axios3.post('/poster/poster/update', payload)
/* 获取海报模型 */
export const getPoster = id => axios3.post('/poster/poster/get', {id})
/* 分页获取海报 */
export const getPosterList = payload => axios3.post('/poster/poster/list', payload)
/* 删除海报模型 */
export const delPoster = payload => axios3.post('/poster/poster/delete', payload)
/* 批量删除海报模型 */
export const delMultPoster = payload => axios3.post('/poster/poster/batchDelete', payload)
/* 移动到内容性质 */
export const setPosterAttr = payload => axios3.post('/poster/poster/updateAttributes', payload)
/* 海报审核列表 */
export const getPosterCheckList = payload => axios3.post('/poster/poster/approveList', payload)
/* 发布审核 */
/* 微信发布审核列表 */
export const getWxCheckList = payload => axios.post('/content/audit/vi/list/wx', payload)
/* 短信发布审核列表 */
export const getSmsCheckList = payload => axios.post('/content/audit/vi/list/sms', payload)
/* 邮件发布审核列表 */
export const getMailCheckList = payload => axios.post('/content/audit/vi/list/email', payload)
/* 发布审核操作 */
export const setReleaseCheck = payload => axios.post('/content/audit/vi/do', payload)
/* 获取待审核数量 */
export const getReleaseCheckNum = payload => axios.post('/content/audit/vi/num', payload)
/* 获取短信内容列表 */
export const getSmsNewsList = payload => axios.post('/content/sms/list', payload)
/* 编辑短信 */
export const editSms = payload => axios.post('/content/sms/saveorupdate', payload)
/* 获取短信详情 */
export const getSmsDetail = (id) => axios.get('/content/sms/get', {params: {id}})
/* 获取邮件内容列表 */
export const getMailNewsList = payload => axios.post('/content/email/list', payload)
/* 编辑邮件 */
export const editMail = payload => axios.post('/content/email/saveorupdate', payload)
/* 获取邮件详情 */
export const getMailDetail = (id) => axios.get('/content/email/get', {params: {id}})
/* 获取当前使用的邮件平台消息 */
export const getCurMailplt = () => axios.get('/content/emailplt/get/current')
/* 创建邮件/短信发送计划 */
export const newSendPlan = payload => axios.post('/content/sendplan/emailsms/create', payload, {headers: {'Content-Type': 'application/json'}})
/* 发送记录 */
export const sendRecord = id => axios.get('/content/sendplan/record/list', {params: {id}})
/* 发送记录下载 */
export const sendRecordDownLoad = planId => axios.get('/content/sendplan/detail/download', {params: {planId}})
/* 生成短链接 */
export const setShortLink = payload => axios.post('/dwz/shorten', payload)
/* 测试发送 */
export const testSend = payload => axios.post('/content/sendplan/test/send', payload)
/* 置顶内容 */
export const topContent = (id, top) => axios.post('/content/common/top', {
  id,
  top
}, {headers: {'Content-Type': 'application/json'}})
/* 删除内容 */
export const delContent = (id, del) => axios.post('/content/common/del', {
  id,
  del
}, {headers: {'Content-Type': 'application/json'}})
/* 获取表单列表 */
export const getFormList = payload => axios2.post('/content/form/list', payload, {headers: {'Content-Type': 'application/json'}})
/* 删除表单检测是否被插入微页面 */
export const delFormCheck = payload => axios2.post('/content/form/isExists', payload, {headers: {'Content-Type': 'application/json'}})
/* 批量删除表单 */
export const delFormList = payload => axios2.post('/content/form/delete/batch', payload, {headers: {'Content-Type': 'application/json'}})
/* 获取表单详细 */
export const getFormDetail = payload => axios2.get('/content/form/get/one/' + payload, {headers: {'Content-Type': 'application/json'}})
/* 获取表单详细(根据formId) */
export const getFormDetail2 = payload => axios2.get('/content/form/get/formId/' + payload, {headers: {'Content-Type': 'application/json'}})
/* 提交表单数据 */
export const saveForm = payload => axios2.post('/content/form/saveorupdate', payload, {headers: {'Content-Type': 'application/json'}})
/* 表单数据生成二维码预览 */
export const viewForm = payload => axios2.get('/content/form/get/qrcode/' + payload)
/* 获取支付公众号列表 */
export const getWXpayAccountList = payload => axios3.post('/wxthird/wxpay/getPayAppList', payload)
/* 获取当前授权可用公众号列表 */
export const getWXvalidAccountList = payload => axios3.post('/wxthird/manager/list/valid', payload)
/* 获取卡券列表 */
export const getWXcardList = payload => axios3.post('/marketing/cardtemplate/getlist', payload)
export const getWXcardList1 = payload => axios3.post('/wxthird/wxcard/getWXcardList', payload)
/* 发布表单数据 */
export const publishForm = payload => axios2.post('/content/form/direct/publish/' + payload)
// 0、微页面版本记录
export const version = payload => axios2.get('content/micro/statistic/version', {params: payload})
// 0.1 预览
export const previewForm = (logicId) => axios2.get('content/form//preview/' + logicId, {responseType: 'text'})
// 1、获取访问量、提交量、提交量(微页面数据统计、表单数据统计通用)
export const accessAndsubmit = payload => axios2.post('formPage/accessAndsubmit', payload)
// 2、页面访问数据来源
export const accessSource = payload => axios2.post('formPage/accessSource', payload)
// 3、访问量统计(微页面数据统计、表单数据统计通用)
export const accessStatistics = payload => axios2.post('formPage/accessStatistics', payload)
// 4、访问量列表(微页面数据统计、表单数据统计通用)
export const accessList = payload => axios2.post('formPage/accessList', payload, {headers: {'Content-Type': 'application/json'}})
// 5、转发量、转发者带来的访问量、转发者带来的提交量
export const forwardStatistics = payload => axios2.post('formPage/forwardStatistics', payload)
// 6、分享列表展示
export const forwardList = payload => axios2.post('formPage/forwardList', payload)
// 7、获取表单数据
export const submitList = payload => axios2.post('formPage/submitList', payload, {headers: {'Content-Type': 'application/json'}})
// 8、操作渠道
export const optionChannel = payload => axios2.post('customer/formPage/optionChannel', payload, {headers: {'Content-Type': 'application/json'}})
// 9、分页获取渠道
export const queryChannel = payload => axios2.post('customer/formPage/queryChannel', payload, {headers: {'Content-Type': 'application/json'}})
// 10、全量获取渠道
export const getAllChannel = () => axios2.post('customer/formPage/getAllChannel')
// 11、创建可追踪的URL
export const addTraceableUrl = payload => axios2.post('customer/formPage/addTraceableUrl', payload, {headers: {'Content-Type': 'application/json'}})
// 12、删除可追踪的URL
export const delTraceableUrl = payload => axios2.post('/customer/formPage/delTraceableUrl', payload, appJson)
// 13、查询可追踪渠道URL
export const queryTraceableUrl = payload => axios2.post('customer/formPage/queryTraceableUrl', payload, {headers: {'Content-Type': 'application/json'}})
// 14 微页面访问url地址接口
export const urlQrContainer = ({logicId}) => axios2.get('content/micro/statistic/url/get/' + logicId)
// 15、查询订单记录
export const queryOrderList = payload => axios2.post('customer/formPage/queryOrderList', payload, {headers: {'Content-Type': 'application/json'}})
// 15.1、下载订单模板
export const downTemplate = () => axios2.post('customer/formPage/downTemplate', {headers: {'Content-Type': 'application/json'}})
// 15.1、导入客户订单
export const importOrder = 'customer/formPage/importOrder'
/* 营销活动 */
// 获取活动列表
export const getCamignList = payload => axios3.post('/marketing/activity/manager/list', payload)
// 新建活动
export const newCampaign = payload => axios3.post('/marketing/activity/manager/save', payload)
// 获取详情
export const getCampaignDetail = payload => axios3.post('/marketing/activity/manager/detail', payload)
// 设置预热,活动,结束微页面
export const setActivityPage = payload => axios3.post('/marketing/activity/manager/page/edit', payload)
// 新增海报微页面
export const setPostPageData = payload => axios3.post('/marketing/activity/manager/poster/add', payload)
// 获取预热,活动,结束微页面
export const getActivityPage = payload => axios3.post('/marketing/activity/manager/page/edit', payload)
// 修改微页面
export const savePostPageData = payload => axios3.post('/marketing/activity/manager/save', payload)
// 活动报表--总部数据
export const getCampaignReport1 = payload => axios3.post('/marketing/activity/manager/hqdata', payload)
// 活动报表--主体数据
export const getCampaignReport2 = payload => axios3.post('/marketing/activity/manager/maindata', payload)
// 活动报表--认筹明细
export const getCampaignReport3 = payload => axios3.post('/marketing/activity/manager/submitdetail', payload)
// 新活动报表 - 分公司列表
export const getReportDepartment = () => axios3.get('/marketing/activity/manager/department/list')
// 新活动报表 - 分公司汇总
export const getBranchCompanyCollect = payload => axios3.post('/marketing/activity/manager/data/sale/department', payload)
// 新活动报表 - 传播明细
export const getSpreadDetails = payload => axios3.post('/marketing/activity/manager/data/sale/staff', payload)
// 新活动报表 - 参与明细
export const getPartakeDetails = payload => axios3.post('/marketing/activity/manager/data/user', payload)
// 活动下发
export const issueCampaign = payload => axios3.post('/marketing/activity/manager/push/user', payload, appJson)
export const issueCampaign2 = payload => axios3.post('/marketing/activity/manager/push/department', payload, appJson)
export const issueCampaign3 = payload => axios3.post('/marketing/activity/manager/issued/children', payload, appJson)
// 活动详情-公众号配置
export const setWxMpInfo = payload => axios3.post('/marketing/activity/manager/wxmpshare/save', payload, appJson)
/* 修改活动时间 */
export const setActivityTime = payload => axios3.post('/marketing/activity/manager/time/edit', payload)
//删除营销活动
export const delCampaignItem = payload => axios3.post('/marketing/activity/manager/delete', payload, appJson)
//获取卡券模版列表
export const getCouponList = payload => axios3.post('/marketing/cardtemplate/list', payload)
//根据id获取卡券详情
export const getCouponItem = payload => axios3.post('/marketing/cardtemplate/getone', payload)
//根据条件搜索卡券
export const getCouponByCondition = payload => axios3.post('/marketing/cardtemplate/listcondition', payload)
//创建卡券模版
export const createCoupon = payload => axios3.post('/marketing/cardtemplate/add', payload)
//复制卡券模板
export const copyCoupon = payload => axios3.post('/marketing/cardtemplate/copy', payload)
//修改卡券模板
export const editCoupon = payload => axios3.post('/marketing/cardtemplate/update', payload)
//删除卡券模板
export const deleteCoupon = payload => axios3.post('/marketing/cardtemplate/delete', payload)


/*=====================================*
 *             四期贬损管理              *
 *=====================================*/

// const devUrl1 = 'http://10.120.41.7:8310'
// const devUrl2 = 'http://10.120.40.5:8310'


// 获取分公司列表
export const getDepartment = () => axios3.get('/online/department/branch/list')

// 获取文件上传uptoken
export const getUploadToken = () => axios3.post('/file/file/private/uptoken')

// 获取文件下载url
export const getDownloadUrl = (url) => axios3.post('/file/file/private/download/url', {url: url})


// 获取顶级筛选条件的请求pid
export const getTopLevelPid = query => axios3.post('/nps/nps/condition/header', query, appJson)

// 获取顶级筛选选条件
export const getFilterConditions = query => axios3.post('/nps/nps/condition', query, appJson)

// 获取表格列表
export const getFilterList = (query, currentIndex, pageSize) => axios3.post(`/nps/nps/get/advanced?page=${currentIndex}&size=${pageSize}`, query, appJson)

// 获取订单详情
export const getOrderDetails = queryStr => axios3.get(`/nps/nps/approve/detail?${queryStr}`, appJson)


// 用户运营中心贬损下发审批
export const userOpnCenterNext = payload => axios3.post(`/nps/nps/user/giveout`, payload)

// 用户运营中心贬损转化审批
export const userOpnCenterTrans = payload => axios3.post(`/nps/nps/user/transform`, payload)

// 用户运营中心二次回访审批
export const userOpnCenterVisit = payload => axios3.post(`/nps/nps/user/visit`, payload)

// 销司总部贬损下发审批
export const saleHQNext = payload => axios3.post(`/nps/nps/center/giveout`, payload)

// 销司总部贬损者转化审核
export const saleHQTrans = payload => axios3.post(`/nps/nps/center/transform`, payload)

// 销司总部二次回访审批
export const saleHQVisit = payload => axios3.post(`/nps/nps/center/visit`, payload)

// 分公司管理员下发
export const subAdminNext = payload => axios3.post(`/nps/nps/branch/giveout`, payload)

// 分公司管理员处理
export const subAdminHandle = payload => axios3.post('/nps/nps/branch/handle', payload, appJson)

// 分公司管理员一键下发
export const subAdminOneKeyNext = orders => axios3.post('/nps/nps/branch/giveall', orders, appJson)


/*=====================================*
 *               NPS报表               *
 *=====================================*/

// EasyMock接口
// const npsReportsMockBaseUrl = 'https://www.easy-mock.com/mock/5b56e4eb838693275efb0758/nps-reports'

// 赵宁接口
// const npsReportsMockBaseUrl = 'http://10.120.41.7:8310'

const npsReportsMockBaseUrl = ''

// 获取报表列表
export const getNpsReports = payload => axios3.post(npsReportsMockBaseUrl + `/nps/nps/report/get/reportList`, payload)

// 获取报表详情
export const getNpsReportDetails = payload => axios3.post(npsReportsMockBaseUrl + `/nps/nps/report/detail`, payload)

// 获取新增报表订单列表
export const getNpsReportsOrders = payload => axios3.post(npsReportsMockBaseUrl + `/nps/nps/report/get/baseInfo`, payload)

// 获取订单详情
export const getNpsReportsOrderDetails = payload => axios3.post(npsReportsMockBaseUrl + `/nps/nps/report/baseInfo/detail`, payload)

// 删除/批量删除
export const removeNpsReportsOrders = payload => axios3.post(npsReportsMockBaseUrl + '/nps/nps/report/delete', payload, appJson)

// 手动分类
export const npsReportsClassify = (payload, classifyType) => axios3.post(npsReportsMockBaseUrl + `/nps/nps/report/manual/classify?classifyType=${classifyType}`, payload, appJson)

// 生成报表
export const npsCreateReports = payload => axios3.post(npsReportsMockBaseUrl + `/nps/nps/report/create`, payload)

// 报表重命名
export const renameNpsReport = payload => axios3.post(npsReportsMockBaseUrl + `/nps/nps/report/modify/reportName`, payload)

// 图表重命名
export const renameNpsReportChart = payload => axios3.post(npsReportsMockBaseUrl + `/nps/nps/report/modify/tableName`, payload)


/*=====================================*
 *               群组管理               *
 *=====================================*/

// EasyMock接口
// const groupsManageBaseUrl = 'https://www.easy-mock.com/mock/5b6bb4ba2681c8397f8532ac/groupsManage'

// 赵宁接口
const groupsManageBaseUrl = 'http://10.120.41.14:8210'

// 获取群组列表*
export const getChannelList = payload => axios3.get(groupsManageBaseUrl + `/cluster/group/getChannel?channelType=${payload}`)

// 获取群组列表
export const getGroupsList = payload => axios3.post(groupsManageBaseUrl + '/cluster/group/findCroupClusterInfo', payload)

// 删除群组列表
export const removeGroupsList = payload => axios3.post(groupsManageBaseUrl + '/cluster/group/deleteCroupCluster', payload)

// 获取群组成员列表
export const getGroupMemberList = payload => axios3.post(groupsManageBaseUrl + '/groupMembers', payload)
